package com.gof.example.observer;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/12 19:34.
 * haiming.fei@tongdun.cn
 */
public class App {

    public static void main(String[] args) {
        Investor a, b, c, d;
        Stock s, s1;

        a = new Investor("郑少秋");
        b = new Investor("郑伊健");
        c = new Investor("刘德华");
        d = new Investor("梁朝伟");

        s = new Stock(90);
        s.follow(a);
        s.follow(b);
        s.follow(c);
        s.follow(d);

        s.changePrice(10);
        System.out.println("-------------------------");
        s.changePrice(-5);

        System.out.println("=========================");
        s1 = new Stock(900);
        s1.follow(a);
        s1.follow(b);
        s1.follow(c);
        s1.follow(d);

        s1.changePrice(10);
        System.out.println("-------------------------");
        s1.changePrice(-15);
    }

}
